#include<bits/stdc++.h>
#define int long long
#define M 998244353
using namespace std;
int n,K,b[200005],sz[200005],f[200005],h[200005],ans=0;
struct ok{
	int x,y;
}a[200005];
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*f;
}
inline int find(int k){
	if(k==f[k]) return k;
	return f[k]=find(f[k]);
}
inline void dfs(int k,int g,int F){
	if(k==(n+1)){
		for(int i=1;i<=g;i++) sz[i]=0;
		for(int i=1;i<=n;i++) sz[b[i]]++;
		for(int i=1;i<=g;i++) if(sz[i]==0) return;
		for(int i=1;i<=n;i++) f[i]=i;
		for(int i=1;i<=g;i++) h[i]=-1;
		for(int i=1;i<n;i++){
			if(b[a[i].x]==b[a[i].y]){
				int t1=find(a[i].x),t2=find(a[i].y);
				if(t1==t2) continue;
				f[t1]=f[t2];
			}
		}
		for(int i=1;i<=n;i++){
			if(h[b[i]]==-1) h[b[i]]=find(i);
			else{
				if(find(i)!=h[b[i]]) return;
			}
		}
		ans++;
		return;
	}
	for(int i=F;i<=g;i++){
		b[k]=i;
		dfs(k+1,g,i);
	}
}
signed main(){
	freopen("soft.in","r",stdin);
	freopen("soft.out","w",stdout);
	n=read(),K=read();
	for(int i=1;i<n;i++) a[i].x=read(),a[i].y=read();
	for(int i=1;i<=K;i++){
		ans=0;
		dfs(1,i,1);
		cout<<ans<<"\n";
	}
	return 0;
}

